<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>DS_SaoDiSheng</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8" />
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="css/xadmin.css">
    <script src="lib/layui/layui.all.js" charset="utf-8"></script>
    <script src="js/jquery.min.js"></script>
    <script src="js/vue/2.5.16/vue.min.js"></script>
    <script src="js/axios/0.17.1/axios.min.js"></script>
    <script type="text/javascript" src="js/xadmin.js"></script>

</head>

<body>
<script>
    $(function () {
        var data4Vue = {
            uri: 'forecounts',
            oc: 0,
            uc: 0,
            sc: 0,
            vc: 0,
            pc: 0
        };

        // ViewModel
        var vue = new Vue({
            el: '#workingArea',
            data: data4Vue,
            mounted: function () {
                this.load();
            },
            methods: {
                load: function () {
                    var url = this.uri;
                    axios.get(url).then(function (response) {
                        var result = response.data;
                        vue.oc = result.data.oc;
                        vue.uc = result.data.uc;
                        vue.sc = result.data.sc;
                        vue.vc = result.data.vc;
                        vue.pc = result.data.pc;
                    });
                }
            }
        });

    })
</script>


<div class="layui-fluid" id="workingArea">
    <div class="x-nav">
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
        </a>
    </div>
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header">数据统计</div>
            <div class="layui-card-body ">
                <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                    <li class="layui-col-md2 layui-col-xs6">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>订单数量</h3>
                            <p>
                                <cite>{{oc}}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-md2 layui-col-xs6">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>用户数量</h3>
                            <p>
                                <cite>{{uc}}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-md2 layui-col-xs6">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>配送员数量</h3>
                            <p>
                                <cite>{{sc}}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-md2 layui-col-xs6">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>运输工具数量</h3>
                            <p>
                                <cite>{{vc}}</cite></p>
                        </a>
                    </li>
                    <li class="layui-col-md2 layui-col-xs6">
                        <a href="javascript:;" class="x-admin-backlog-body">
                            <h3>包裹数</h3>
                            <p>
                                <cite>{{pc}}</cite></p>
                        </a>
                    </li>

                </ul>
            </div>
        </div>
    </div>
</div>
</body>
</html>